import { defineComponent, ref } from 'vue'
import { Empty } from 'ant-design-vue'
import PropTypes from '@/utils/PropTypes'

export default defineComponent({
  name: 'EmptyCom',
  props: {
    text: PropTypes.string().def(),
    image: PropTypes.string().def(),
  },
  setup(props) {
    const emptyStyle = {
      width: '100%',
      height: '100%',
      position: 'absolute',
      top: '50%',
      left: '50%',
      zIndex: 999,
      transform: 'translate(-50%, -50%)',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
    } as any
    return () => (
      <div style={emptyStyle}>
        <Empty description={props.text} image={props.image} />
      </div>
    )
  },
})
